package com.itheima.health.dao;


import com.itheima.health.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

@Mapper
public interface MemberDao {
    /**
     * 今日新增会员
     * @param today
     * @return
     */
    Integer findMemberCountByDate(String today);

    /**
     * 返回会员总数
     * @return
     */
    Integer findMemberCount();

    /**
     * 返回本周新增会员
     * @param lastWeek
     * @return
     */
    Integer findMemberCountWeekByDate(String lastWeek);

    /**
     * 返回本月新增会员
     * @param dateFormat
     * @return
     */
    Integer findMemberCountMonthByDate(String dateFormat);


    /**
     * 根据手机号查询
     * @param phoneNumber
     * @return
     */
    Member selectByPhoneNumber(@Param("phoneNumber") String phoneNumber);

    /**
     * 根据id更新非空字段
     * @param member
     */
    void updateByIdSelective(Member member);

    /**
     * 插入
     * @param member
     */
    void insert(Member member);
    /**
     * 根据ID查询
     * @param id
     * @return
     */
    Member selectById(@Param("id") Integer id);


    Integer findMemberCountBeforeDate(@Param("value") String date);

}
